import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/godownEntryDetail',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/godownEntryDetail/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/godownEntryDetail',
    method: 'put',
    data
  })
}

export function list(id) {
  return request({
    url: 'api/godownEntryDetail/list/' + id,
    method: 'get'
  })
}

export function download(id, godownEntryDate) {
  var params = {
    'godownEntryId': id,
    'godownEntryDate': godownEntryDate
  }
  return request({
    url: 'api/godownEntryDetail/download',
    method: 'get',
    responseType: 'blob',
    params
  })
}

export function getSupplierSettlmentData(params) {
  return request({
    url: 'api/godownEntryDetail/getSupplierSettlmentData',
    method: 'post',
    params
  })
}

export default { add, edit, del, list, download, getSupplierSettlmentData }
